package fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import qf.wlh.com.oneprisdent.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class ActivityFragment extends Fragment {


    private WebView activityFragmentWebView;

    public ActivityFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_activity,container,false);

        activityFragmentWebView = ((WebView) view.findViewById(R.id.activity_fragment_webview));
        // 设置WebView的客户端
        activityFragmentWebView.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                return false;// 返回false
            }
        });
        activityFragmentWebView.loadUrl("http://api.yixi.tv/api/v1/activity/htmlpage");
        return view;
    }

}
